Field of the Invention
The present invention relates to a numerical controller, and particularly to a numerical controller that allows a single auxiliary function (MSTB code: generic name for M code, S code, T code, and B code) to be executed at multiple timings.
Description of the Related Art
An auxiliary function is provided as an instruction for turning on and off devices, selecting tools, and controlling the number of rotations of a spindle, for example, on the machine side. When an auxiliary function is instructed, a code signal, a strobe signal, and a completion signal are sequentially exchanged between a numerical controller and the machine. While the machine side performs various operations between receipt of the code signal and strobe signal, and returning of the completion signal, some of the operations (preparatory operation) can be performed in advance. However, the current structure does not allow operations including the preparatory operation on the machine side to be initiated, until a block of an auxiliary function is executed. This indicates that time is wasted for the execution time of the preparatory operation.
As a solution to the above problem, there is a method to instruct only the preparatory operation part in advance. For example, FIG. 7A shows an example of a general program, in which instructions are executed sequentially with the preparatory operation not executed in advance. In FIG. 7A, “Txx (xx indicates a numerical value)” is a tool preparation instruction, and “M06” is a tool exchange instruction. Here, the tool preparation instruction can be executed (prepared), before actually exchanging tools according to the tool exchange instruction.
Hence, by giving the tool preparation instruction “Txx (xx indicates a numerical value)” beforehand in the step before the step of executing the tool exchange instruction, as shown in FIG. 7B, the time loss caused by the execution time of the preparatory operation can be eliminated to some extent. However, this method requires the preparatory operation instruction to be included in the machining program of the previous step, which causes other problems, such as complication of the machining program, and increase in the modification amount of the machining program when interchanging the steps.
As a solution taking into account these other problems, there is a method (see Japanese Patent Application Laid-Open No. 2010-33150, for example) that allows an independently executable auxiliary function, such as tool preparation, to be executed earlier than the machining program command. This is achieved by providing a controller (second machining program analysis unit and other parts) for analyzing and executing only the auxiliary function, in addition to a controller (first machining program analysis unit and other parts) for performing main analysis and execution. Note that in this conventional technique, an auxiliary function that can be executed independently, such as tool preparation, is referred to as an “independent auxiliary function” and, conversely, an auxiliary function that cannot be executed independently, such as tool exchange, is referred to as a “dependent auxiliary function.”
By adopting the method described in aforementioned Japanese Patent Application Laid-Open No. 2010-33150, the independent auxiliary function command of step 2 can be analyzed and executed beforehand in step 1 as in the timing chart of FIG. 8B, without moving the position of the independent auxiliary function command in the program as in FIG. 8A. However, use of the method described in Japanese Patent Application Laid-Open No. 2010-33150 just allows the control unit for analyzing and executing only the auxiliary function to execute the auxiliary function earlier than the program command, and the execution timing depends on the control unit. Hence, the auxiliary function cannot always be executed at an appropriate timing on the machine side.
For example, when performing tool preparation on the first path side of a dual-path machine, simply initiating the execution early is not appropriate, when the second path side is in the middle of processing and influence of vibration needs to be considered even though early initiation of tool preparation is desired, or when a consumable is used and waste needs to be avoided.
Also, both methods of the conventional techniques require the target program to be separated beforehand into an independent auxiliary function such as “Txx (tool preparation instruction),” and a dependent auxiliary function such as “M06 (tool exchange instruction).” Accordingly, the conventional techniques are not applicable to a case of instructing multiple operations by an auxiliary function command, which is originally a single instruction.